package com.sky.mapper;

import com.sky.entity.User;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import java.util.List;

@Mapper
public interface UserMapper {

    /**
     * 根据用户名获取用户
     * @param username
     * @return
     */
    @Select("select * from user where username=#{username}")
    User getByUsername(String username);


    void insert(User user);
    @Select("select * from user")
    List<User> getAll();
    @Update("update user set status=#{status} where id=#{id}")
    void updateStatus(Integer id, Integer status);
    @Delete("delete from user where id=#{id}")
    void deleteNoPassById(Integer id);
}
